package com.base.key.domain.bo;
import com.base.common.core.domain.BaseEntity;
import com.base.common.core.validate.AddGroup;
import com.base.common.core.validate.EditGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.*;

import java.util.Date;

/**
 * 密钥在用表业务对象 t_key_use
 *
 * @author base
 * @date 2023-10-17
 */

@Data
@EqualsAndHashCode(callSuper = true)
public class TKeyUseBo extends BaseEntity {

    /**
     * key
     */
    @NotBlank(message = "key不能为空", groups = { EditGroup.class })
    private String keyCode;

    /**
     * 密钥类型(1-AES256 2-定制算法)
     */
    @NotBlank(message = "密钥类型(1-AES256 2-定制算法)不能为空", groups = { AddGroup.class, EditGroup.class })
    private String keyType;

    /**
     * 密钥长度(默认32字节)
     */
    @NotNull(message = "密钥长度(默认32字节)不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long keyLen;

    /**
     *
     */
    @NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
    private String operator;

    /**
     *
     */
    @NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
    private String remark;

    /**
     * 密钥值
     */
    @NotBlank(message = "密钥值不能为空", groups = { AddGroup.class, EditGroup.class })
    private String keyValue;

    /**
     * 校验码
     */
    @NotBlank(message = "校验码不能为空", groups = { AddGroup.class, EditGroup.class })
    private String checkStatus;

    /**
     * 密钥状态(1-备用)
     */
    @NotBlank(message = "密钥状态(1-备用)不能为空", groups = { AddGroup.class, EditGroup.class })
    private String status;

    /**
     * 使用者编码(user_flag为1时标识密码卡编码，为2是表示应用编码)
     */
    @NotBlank(message = "使用者编码(user_flag为1时标识密码卡编码，为2是表示应用编码)不能为空", groups = { AddGroup.class, EditGroup.class })
    private String userCode;

    /**
     * 使用者标识(1-密码卡 2-应用)
     */
    @NotBlank(message = "使用者标识(1-密码卡 2-应用)不能为空", groups = { AddGroup.class, EditGroup.class })
    private String userFlag;

    /**
     * 密钥生成时间
     */
    @NotNull(message = "密钥生成时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private Date keyCreateTime;

    /**
     * 密钥更新时间
     */
    @NotNull(message = "密钥更新时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private Date keyUpdateTime;

    /**
     * 密钥启用时间
     */
    @NotNull(message = "密钥启用时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private Date keyStartTime;

    /**
     * 密钥失效时间
     */
    @NotNull(message = "密钥失效时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private Date keyExpireTime;


}
